<?php

namespace App\System\Order\Repositories;

use App\System\Base\Helpers\Traits\SinglePattern;
use App\System\Base\Repositories\Repository;
use App\System\Order\Model\OrderExpressList;

class OrderExpressListRepository extends Repository
{
    use SinglePattern;

    /*
     * 物流列表
     * $getAll=false:获取分页数据 trueh：获取全部数据
     */
    public function getList($getAll=false)
    {
        if($getAll){
            $data = OrderExpressList::get();
        }else{
            $data = OrderExpressList::paginate();
        }
        return $data;
    }

    /**
     * 通过物流公司名查询记录
     */
    public function getByName($name)
    {
       return OrderExpressList::where('name',$name)->first();
    }


}